<?php
function hasVal($string){
	if (isset($string)) {
		if(strlen(trim($string)) > 0)
			return true;
		else
			return false;
	}
	else
		return false;
}

function makeDbSafe($string) {
	if (get_magic_quotes_gpc())
		stripslashes($string);
	
	$string = str_replace(">", "&gt;", $string);
	$string = str_replace("<", "&lt;", $string);
	$string = str_replace("%", "&#37;", $string);
	
	return addslashes($string);
}
?>
